<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link id="linkstyle" rel='stylesheet' href='markdown.css'/>
    <style type="text/css">
        .leftMeta {
            background: #f5f6f7;
            float: left;
            padding: 1em;
            margin: 1em;
        }

        .metaRow {
            margin: 2px;
            padding: 1px;
        }

        .metaRow:active:focus, .metaRow:hover {
            border: 1px solid #707070;
        }

        .rightContent {
            float: left;
            padding: 1em;
            margin: 1em;
        }
    </style>
    <script type="application/javascript" src="marked.min.js">
    </script>
    <script type="application/javascript">
        let token = localStorage.getItem("token");

        function send(url, method, head, body) {
            let requestConfig = {
                method: method,
                headers: {'token': token, 'Content-Type': 'application/json;charset=UTF-8', ...head},

            }
            if (body != null) {
                requestConfig.body = JSON.stringify(body)
            }
            return fetch(new Request(url, requestConfig)).then(res => res.json());
        }
    </script>
</head>
<body>
<script type="application/javascript">
    function addMeta(name) {
        return send("/book/saveMeta", "POST", {}, {name: name});
    }

    function delMeta(id) {
        return send(`/book/deleteMeta?id=${id}`, "DELETE", {}, {});
    }

    function pageMeta(search, page, size) {
        return send(`/book/pageMeta?page=${page}&size=${size}`, "POST", {}, search);
    }

    function getValueEditDiv(id) {
        let html = document.getElementById(id).innerHTML;
        html =html.replace(/\<div\>(.*?)\<\/div\>/g,'\n$1').replace(/<br>/g,'');
        return html;
    }
</script>
<div class="leftMeta">

    <input type="text" placeholder="输入名称搜索">
    <br>
    <input type="text" placeholder="输入名称添加">
    <div class="metaContent">
        <div class="metaRow">1232</div>
        <div class="metaRow">3123</div>
    </div>
    <div>
        <input type="button" value="prev">
        <input type="number" style="width: 1em"> <code id="total">/12</code>
        <input type="button" value="next">
    </div>
</div>
<div class="rightContent">
    <div contenteditable="true" id="x1">这里可以编辑</div>
</div>
</body>
</html>